#include <iostream>
using namespace std;
int main(){
    std::string str;
    std::cin >> str;
    int cntletter = 0;
    double score = 0;
    for(char ch : str){
        if(ch >= 'A' && ch <= 'D'){
            cntletter++;
            score += 'D' - ch + 1;
        }
        else if(ch == '+') score += 0.3;
        else score-=0.3;
    }
    double gpa = score / cntletter;
    std::cout << std::fixed << std::setprecision(2) << gpa << endl;
    return 0;
}